מדרש אויף שמואל א 17:42

וַיַּבֵּ֧ט הַפְּלִשְׁתִּ֛י וַיִּרְאֶ֥ה אֶת־דָּוִ֖ד וַיִּבְזֵ֑הוּ כִּֽי־הָיָ֣ה נַ֔עַר וְאַדְמֹנִ֖י עִם־יְפֵ֥ה מַרְאֶֽה׃

און דער פּלִשתּי האָט אַ קוק געטאָן און האָט דערזען דָוִדן, און האָט אים פֿאַראַכט, װאָרום ער איז געװען אַ ייִנגל, און גערױטלט, אױך שײן אױפֿן פּנים.

Mekhilta DeRabbi Yishmael

There is a warrior in a province, accoutered in all the weapons of war, but lacking power, strength, stratagem, and war (wisdom). Not so, the Holy One Blessed be He. He possesses all of these. As it is written (I Samuel 17:42) "For unto the L–rd is the war, and He will deliver you into our hands." And it is written (Psalms 144:1) ("A psalm) of David: Blessed is the L–rd, my Rock, who trains my hands for battle, my fingers for war."
פֿרעגט אַ רבֿBookmarkShareCopy

Midrash Tehillim

I am young and despised, etc. David was young, but wasn't Eliab the eighth? As it says, "David the seventh, but Eliab the eighth." (1 Chronicles 2:15) Eliab came after David, but made himself small, as it says, "I am young and despised, etc." (1 Samuel 17:42) Saul insulted him greatly. As it says, "And it came to pass at the time when Merab, Saul's daughter, should have been given to David, that she was given unto Adriel, etc." (1 Samuel 18:19) And also, "Saul gave him Michal his daughter to wife, etc." (1 Samuel 18:27) Therefore it says, "I am young and despised, etc." Your righteousness is an everlasting righteousness, etc. Thus David said, "The righteousness that you do with a person whom you give a gift to and do not take back from him is a righteous act." And it is written, "The scepter shall not depart from Judah, etc." (Genesis 49:10) Therefore it says, "Your righteousness is an everlasting righteousness, etc." "Distress and anguish have overtaken me, etc." Just as Moses said, "In distress and anguish." (Deuteronomy 28:53) When troubles come, so do good things and comforts. Therefore it says, "Distress and anguish have overtaken me, etc." "Your testimonies are righteous forever." The merit that was given to Israel was not for a year or years or a hundred years, but forever. As it says, "My words... shall not depart from your mouth, etc." (Isaiah 59:21) And the reward for it is length of days in her right hand.
פֿרעגט אַ רבֿBookmarkShareCopy